﻿@{
    ViewBag.Title = "CreateVacation";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="../../Scripts/jquery-ui-1.8.11.js" type="text/javascript"></script>
<link href="../../Content/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css" />

 
@model vITs.Site.Models.ActionModels.CreateVacationModel
           
<script type="text/javascript">
    $(function () {
        $("#StartDateVacation").datepicker();
        $("#EndDateVacation").datepicker();
    });
    @{ var assignment = ViewBag.assignment;}

</script>
@using (this.Html.BeginForm("CreateVacation", "Vacation", new { AssignmentId = ViewBag.assignment.AssignmentId }, FormMethod.Post))
{
    <fieldset>
   <legend><h2>Lägg till ledighet</h2></legend>
    <span>
    Nuvarande uppdrag: @ViewBag.assignment.AssignmentName 
    <br />
    Uppdragets startdatum: @String.Format("{0:yyyy-MM-dd}", ViewBag.assignment.StartDate)
    <br />
    Uppdragets slutdatum: @String.Format("{0:yyyy-MM-dd}", ViewBag.assignment.EndDate)
    </span>
    <br />
    <span style="color:Red">
    @ViewBag.Errors
    </span>
    <br />
    @this.Html.LabelFor(model => model.StartDateVacation)
    @this.Html.EditorFor(model => model.StartDateVacation)
    <br />
    @this.Html.ValidationMessageFor(model => model.StartDateVacation)
    <br />
    @this.Html.LabelFor(model => model.EndDateVacation)
    @this.Html.EditorFor(model => model.EndDateVacation)
    <br />
    @this.Html.ValidationMessageFor(model => model.EndDateVacation)
    <br />
    <input type="submit" value="Lägg till semesterdagar" />
    <br />
    </fieldset>
}
